﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectStorageDB.Objects;

namespace ProjectStorageLib.ParameterizedNomencaltures
{
    public class NomenclatureRetriever : DatabaseEntities
    {
        public NomenclatureRetriever()
        { 
        
        }

        public AllNomenclatures GetAll()
        {
            AllNomenclatures res = new AllNomenclatures();

            res.Factors = ent.Factors.ToList();
            //res.Factors.ForEach(f => ent.Detach(f));

            res.Practices = ent.AgilePractices.ToList();
            //res.Practices.ForEach(p => ent.Detach(p));

            res.Scales = ent.FactorScales.ToList();
            //res.Scales.ForEach(s => ent.Detach(s));

            res.PracticeValues = Enum.GetValues(typeof(EnumPracticeUsingValue)) .Cast<EnumPracticeUsingValue>()
                                .Select(v => new PracticeUsingValue() { Value = v, RawValue = (int)v })
                                .ToList();

            return res;
        }

        protected override void Dispose(bool flag)
        {
        }
    }
}
